import request from '@/utils/request'

// 查询健康数据列表
export function listRecords(query) {
  return request({
    url: '/healthSys/records/list',
    method: 'get',
    params: query
  })
}

// 查询健康数据详细
export function getRecords(healthId) {
  return request({
    url: '/healthSys/records/' + healthId,
    method: 'get'
  })
}

// 新增健康数据
export function addRecords(data) {
  return request({
    url: '/healthSys/records',
    method: 'post',
    data: data
  })
}

// 修改健康数据
export function updateRecords(data) {
  return request({
    url: '/healthSys/records',
    method: 'put',
    data: data
  })
}

// 删除健康数据
export function delRecords(healthId) {
  return request({
    url: '/healthSys/records/' + healthId,
    method: 'delete'
  })
}


export function getBloodSugarData(params) {
  return request({
    url: '/healthSys/records/bloodSugar',
    method: 'get',
    params // 注意这里使用params传递GET参数
  })
}
export function getBloodPressureData (params) {
  return request({
    url: '/healthSys/records/bloodPressure',
    method: 'get',
    params // 注意这里使用params传递GET参数
  })
}